import java.util.Scanner;

public class MatrixNumby {
     public MatrixNumby(){
         Scanner input=new Scanner(System.in);
         System.out.println("请输入一个0和1矩阵，其中只有行的1数量为奇数");
         int[][] matrix =new int[6][6];

         for(int i=0;i<matrix.length;i++){
             for (int j=0;j<matrix[i].length;j++){
                 matrix[i][j]=input.nextInt();
             }
         }
         System.out.println("翻转的牌子在"+"("+getMatrixline(matrix)+","+getMatrixcolum(matrix)+")");
     }

     public int getMatrixline(int[][] matrix){
         //返回数字1个数为奇数的所在行
         int countRow=0;
         int row=0;
         for(int i=0;i<matrix.length;i++){
             for(int j=0;j<matrix[i].length;j++){
                 if (matrix[i][j]==1)
                     countRow++;
             }
             if(countRow%2!=0){
                 row=i;
                 break;
             }
         }
         return row;
     }

     public int getMatrixcolum(int[][] matrix){
         int countColumn=0;
         int column=0;

         for(int j=0;j<matrix[0].length;j++) {
             for (int i = 0; i < matrix.length; i++) {
                 if (matrix[i][j] == 1)
                     countColumn++;
             }
             if (countColumn % 2 != 0) {
                 column = j;
                 break;
             }
         }

         return column;
     }
}
